// import com.alibaba.druid.sql.ast.SQLObject;
// import com.alibaba.druid.sql.ast.SQLStatement;
// import com.alibaba.druid.sql.ast.SQLStatementImpl;
// import com.alibaba.druid.sql.visitor.SQLASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "SQLSubmitJobStatement.h"
#include "../../visitor/SQLASTVisitor.h"

void SQLSubmitJobStatement::accept0(SQLASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(SQLSubmitJobStatement)))
  {
    acceptChild(visitor, statment);
  }
  visitor->endVisit(SharedObject(SQLSubmitJobStatement));
}

// @Override
SQLObject_list_ptr SQLSubmitJobStatement::getChildren()
{
  SQLObject_list_ptr children = std::make_shared<std::list<SQLObject_ptr>>();
  children->push_back(statment);
  return children;
}

BOOL_ptr SQLSubmitJobStatement::isAwait()
{
  return await;
}

void SQLSubmitJobStatement::setAwait(BOOL_ptr await)
{
  this->await = await;
}

SQLStatement_ptr SQLSubmitJobStatement::getStatment()
{
  return statment;
}

void SQLSubmitJobStatement::setStatment(SQLStatement_ptr statment)
{
  this->statment = statment;
}

SQLObject_ptr SQLSubmitJobStatement::clone()
{
  SQLObject_ptr clone_tmp = std::shared_ptr<SQLSubmitJobStatement>(new SQLSubmitJobStatement());
  std::shared_ptr<SQLSubmitJobStatement> x = std::dynamic_pointer_cast<SQLSubmitJobStatement>(clone_tmp);
  // SQLSubmitJobStatement x = new SQLSubmitJobStatement();

  if (statment != nullptr)
  {
    x->setStatment(std::dynamic_pointer_cast<SQLStatement>(statment->clone()));
  }
  return x;
}
